<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * MobileArea控制器
 */
class MobileArea extends AdminBase
{
    
    /**
     * MobileArea列表
     */
    public function MobileAreaList()
    {
        
        $where = $this->logicMobileArea->getWhere($this->param);
        
        $this->assign('list', $this->logicMobileArea->getMobileAreaList($where, 'a.*', 'a.sort desc'));
        
        return $this->fetch('MobileArea_list');
    }
    
    /**
     * MobileArea添加
     */
    public function MobileAreaAdd()
    {
        
        $this->MobileAreaCommon();
        
        return $this->fetch('MobileArea_edit');
    }
    
    /**
     * MobileArea编辑
     */
    public function MobileAreaEdit()
    {
        
        $this->MobileAreaCommon();

        $info = $this->logicMobileArea->getMobileAreaInfo(['a.id' => $this->param['id']], 'a.*');

        
        $this->assign('info', $info);
        
        return $this->fetch('MobileArea_edit');
    }
    
    /**
     * MobileArea添加与编辑通用方法
     */
    public function MobileAreaCommon()
    {
        
        IS_POST && $this->jump($this->logicMobileArea->MobileAreaEdit($_POST));
        

    }



    

    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('CountryMobileArea', $this->param));
    }
    /**
     * 排序
     */
    public function setSort()
    {

        $this->jump($this->logicAdminBase->setSort('CountryMobileArea', $this->param));
    }

    /**
     * MobileArea列表
     */
    public function WallrtPriceList()
    {
        $where=[];
        !empty($this->param['wallet_id']) && $where['wallet_id']=$this->param['wallet_id'];
        $where['is_virtual']=1;
        $this->assign('list', $this->logicMobileArea->getWalletPriceList($where, 'a.*', 'a.create_time desc'));
        $this->assign('wallet',\app\common\model\Wallet::all(['status'=>1,'is_virtual'=>1,'is_currency'=>1]));
        $this->assign('param',$this->param);
        return $this->fetch('wallet_price_list');
    }

    /**
     * MobileArea列表
     */
    public function CurrencyPriceList()
    {
        $where=[];
        !empty($this->param['wallet_id']) && $where['wallet_id']=$this->param['wallet_id'];
        $where['is_virtual']=0;
        $this->assign('list', $this->logicMobileArea->getWalletPriceList($where, 'a.*', 'a.create_time desc'));
        $this->assign('wallet',\app\common\model\Wallet::all(['status'=>1,'is_virtual'=>0,'is_currency'=>1]));
        $this->assign('param',$this->param);
        return $this->fetch('wallet_price_list');
    }


}
